gdkwindow: configure native windows in move_native_children()
authorOlivier Fourdan <ofourdan@redhat.com>
Thu, 6 Oct 2016 14:49:39 +0000 (16:49 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Thu, 13 Oct 2016 06:53:59 +0000 (08:53 +0200)
ClutterEmbed on Wayland uses a subsurface and relocates it on configure
events, but when placed within a scrolled window, no configure event is
emitted and the ClutterEmbed subsurface remains static.

Emit a configure event for native windows in GdkWindow's internal
move_native_children() so that custom widgets relying on configure
events such as ClutterEmbed can relocate their stuff.

Similarly, when switching to/from normal/maximized/fullscreen states
which change the shadows' size and possibly shows/hides a header bar,
we need to emit a configure event even if the abs_x/abs_y haven't
changed to make sure the subsurface is size appropriately.

https://bugzilla.gnome.org/show_bug.cgi?id=771320
https://bugzilla.gnome.org/show_bug.cgi?id=767713

gdk/gdkwindow.c

index 514732d81858325256ef32dd122584b4bcfc154a..bc156dd3d788317d5311e68e4c4d3d6b1e81521b 100644 (file)
@@ -5972,6 +5972,24 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
   _gdk_synthesize_crossing_events_for_geometry_change (window);
 }
 
+static void
+configure_native_child (GdkWindow *window)
+{
+  GdkDisplay *display;
+  GdkEvent *event;
+
+  event = gdk_event_new (GDK_CONFIGURE);
+
+  event->configure.window = g_object_ref (window);
+  event->configure.send_event = FALSE;
+  event->configure.x = window->x;
+  event->configure.y = window->y;
+  event->configure.width = window->width;
+  event->configure.height = window->height;
+
+  gdk_event_put (event);
+  gdk_event_free (event);
+}
 
 static void
 move_native_children (GdkWindow *private)
@@ -5992,7 +6010,10 @@ move_native_children (GdkWindow *private)
                                   child->width, child->height);
        }
       else
-       move_native_children  (child);
+        {
+          configure_native_child (child);
+          move_native_children (child);
+        }
     }
 }
 
@@ -6080,8 +6101,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
                               window->x, window->y,
                               window->width, window->height);
     }
-  else if (old_abs_x != window->abs_x ||
-          old_abs_y != window->abs_y)
+  else
     move_native_children (window);
 
   if (expose)